import http from "@/utils/http";
import type * as System from "@/apis/system/type";

export function getMenuListApi() {
  return http.get<System.MenuItem[]>('/system/menu/all-tree')
}
/** @desc 获取菜单详情 */
export function getMenuDetailApi(params: { id: string }) {
  return http.get<System.MenuItem>(`/system/menu/detail/${params.id}`)
}

/** @desc 保存菜单 */
export function createMenuApi(data: any) {
  return http.post<boolean>('/system/menu/create', data)
}

/** @desc 保存菜单 */
export function modifyMenuApi(data: any) {
  return http.post<boolean>('/system/menu/modify', data)
}

/** 删除菜单 */
export function deleteMenu(id: string) {
  return http.deleted<any>(`/system/menu/${id}`)
}

